Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Aug 29, 2025

This PR implements cloud-based settings synchronization for the extension bridge feature, replacing local storage with CloudService as requested.

Changes

  • Use CloudService.getUserSettings()?.settings?.extensionBridgeEnabled instead of global state for remoteControlEnabled
  • Update CloudService.updateUserSettings when toggling remote control in the webview
  • Add BridgeOrchestrator.connectOrDisconnect handling in the settings update handler
  • Include cloud-based extensionBridgeEnabled in ClineProvider.getState() response

Core Goals Achieved

✅ Don't use contentProxy / globalSettings remoteControlEnabled, use CloudService.instance.getUserSettings()?.settings?.extensionBridgeEnabled
✅ Use CloudService.instance.updateUserSettings to update extensionBridgeEnabled as part of handling the "remoteControlEnabled" webview message
✅ Include CloudService.instance.getUserSettings()?.settings?.extensionBridgeEnabled in the ClineProvider.getState() response under the remoteControlEnabled property
✅ Update BridgeOrchestrator using connectOrDisconnect when cloud user settings change

Testing

  • All existing tests pass
  • Type checking passes
  • Linting passes

Reference

Based on commit dace718 (jr/cloud-control-sync) but using the new BridgeOrchestrator class as requested.


Important

This PR syncs the extension bridge settings with the cloud, replacing local storage with CloudService for managing extensionBridgeEnabled and updating related components accordingly.

  • Behavior:
    • Replace local remoteControlEnabled with CloudService.getUserSettings()?.settings?.extensionBridgeEnabled in ClineProvider.ts and webviewMessageHandler.ts.
    • Update CloudService.updateUserSettings when toggling remote control in the webview.
    • Use BridgeOrchestrator.connectOrDisconnect in extension.ts and ClineProvider.ts to handle cloud settings changes.
  • State Management:
    • Include extensionBridgeEnabled in ClineProvider.getState() response.
    • Update settingsUpdatedHandler in extension.ts to reflect cloud settings changes.
  • Error Handling:
    • Add error logging for cloud settings retrieval and updates in ClineProvider.ts and webviewMessageHandler.ts.
  • Testing:
    • All existing tests pass.
    • Type checking and linting pass.

This description was created by Ellipsis for c512344. You can customize this summary. It will automatically update as commits are pushed.

- Use CloudService.getUserSettings() for remoteControlEnabled instead of global state
- Update CloudService.updateUserSettings when toggling remote control
- Add BridgeOrchestrator.connectOrDisconnect handling in settings update handler
- Remove dependency on contentProxy/globalSettings for remote control state
@roomote roomote bot requested review from cte, jr and mrubens as code owners August 29, 2025 15:45
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. Enhancement New feature or request labels Aug 29, 2025
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Aug 29, 2025
Copy link
Contributor Author

@roomote roomote bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewing my own code is like debugging in a mirror - everything looks backwards but the bugs are still mine.

extensionBridgeEnabled: message.bool ?? false,
})
} catch (error) {
provider.log(`Failed to update cloud settings for remote control: ${error}`)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the cloud settings update fails, we're only logging the error. Should we also show a user-facing notification so they know their setting change didn't persist?

Suggested change
provider.log(`Failed to update cloud settings for remote control: ${error}`)
} catch (error) {
provider.log(`Failed to update cloud settings for remote control: ${error}`)
vscode.window.showErrorMessage('Failed to update remote control setting. Please try again.')
// Don't fall back to local storage - cloud settings are the source of truth
}

sessionId: vscode.env.sessionId,
})
} catch (error) {
cloudLogger(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it intentional that we're not notifying the user when BridgeOrchestrator update fails? The error is logged but users might want to know if their remote control connection has issues.

settingsUpdatedHandler = postStateListener

// Enhanced settings updated handler that also updates BridgeOrchestrator
settingsUpdatedHandler = async () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding JSDoc comments to document this enhanced settings handler's functionality, especially since it now handles BridgeOrchestrator updates in addition to posting state.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Aug 29, 2025
@jr jr merged commit 01458f1 into main Aug 29, 2025
13 checks passed
@jr jr deleted the feature/cloud-bridge-settings-sync branch August 29, 2025 18:09
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Aug 29, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Aug 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement New feature or request Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants